#ifndef PROJECT_H
#define PROJECT_H

#include <QObject>
#include <QString>
#include <QStringList>
#include <QMap>
#include <QVector>
#include <QCoreApplication>

class Project
{
     Q_DECLARE_TR_FUNCTIONS(Project)

public:
    Project(const QString& sourcePath = QString());

    QString sourcePath() const {return m_path;}

    bool isValid() const {return m_valid;}

    QStringList xColumnNames() const {return m_xdata.keys();}
    QStringList yColumnNames() const {return m_ydata.keys();}
    QVector<double> xColumnData(const QString& columnName) const {return m_xdata.value(columnName);}
    QVector<double> yColumnData(const QString& columnName) const {return m_ydata.value(columnName);}

    enum MathOperation {Plus = 0, Minus, Multiply, Devide};

public:
    void update();
    void update(const QString& columnName, int operation, double value);

protected:
    void loadData(const QString& sourcePath);
    void loadDescriptor(const QString& sourcePath);

private:
    QString m_path;
    bool    m_valid;
    QMap<QString, QVector<double> > m_xdata;
    QMap<QString, QVector<double> > m_ydata;
};

#endif // PROJECT_H
